x11: Don't set up frame sync fence on unsupported compositors
authorRay Strode <rstrode@redhat.com>
Tue, 14 Jul 2020 13:40:34 +0000 (09:40 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 14 Jul 2020 18:33:12 +0000 (14:33 -0400)
commitd0ec616fbae86b25009881804ddfdca3a966e945
treee493ee9b29a548fef9fb74006faddb4743a2b1e4
parent38cce2bb181e54143bef1c3510cd81331e40468e
x11: Don't set up frame sync fence on unsupported compositors

Not all compositors support _NET_WM_FRAME_DRAWN.  In cases
where the compositor doesn't support _NET_WM_FRAME_DRAWN we don't
need to do all the fancy damage tracking and fence watching.

Furthermore, if the compositor doesn't support _NET_WM_FRAME_DRAWN,
it's possible that one frame will start before the previous frame has
made it through the pipeline, leading to a blown assertion.

This commit side-steps the unnecessary code and associated assertion
when _NET_WM_FRAME_DRAWN isn't supported.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2927
gdk/x11/gdkglcontext-x11.c
gdk/x11/gdksurface-x11.c
gdk/x11/gdksurface-x11.h